package com.skivingcloud.report.datas.service;

import java.sql.Connection;
import java.sql.SQLException;

import com.skivingcloud.report.datas.entity.ReportDataSource;

public interface IJdbcService {
    /**
     * 删除数据库连接池
     *
     * @param id
     */
    void removeJdbcConnectionPool(String id);


    /**
     * 获取连接
     *
     * @param dataSource
     * @return
     * @throws SQLException
     */
    Connection getPooledConnection(ReportDataSource dataSource) throws SQLException;

    /**
     * 测试数据库连接  获取一个连接
     *
     * @param dataSource
     * @return
     * @throws ClassNotFoundException driverName不正确
     * @throws SQLException
     */
    Connection getUnPooledConnection(ReportDataSource dataSource) throws SQLException;
}